import java.text.SimpleDateFormat;

import java.util.ArrayList;
import java.util.Date;



public class capacity {

	public static void main(String[] argv) throws Exception {
	

		
	String cap = "Date          New Data #BU       Removed #GC    Net Change\n" +
			"----------  ---------- -----  ---------- -----  ----------\n" +
			"2013-06-08   295121 mb 805    -375968 mb 1       -80846 mb\n" +
			"2013-06-09   338074 mb 1214   -381135 mb 1       -43060 mb\n" +
			"2013-06-10   214095 mb 780          0 mb         214095 mb\n" +
			"----------  ---------- -----  ---------- -----  ----------\n" +
			"Average      282430 mb        -252367 mb          30062 mb\n\n" +

			"Top 5 Capacity Clients                     Added  % of Total   ChgRate\n" +
			"-----------------------------------  ------------  ---------- ---------\n" +
			"  us01s-ora28.extranet.mt.com            88231 mb       10.4%    9.640%\n" + 
			"  us01s-ora11.am.mt.mtnet                87425 mb       10.3%    5.074%\n" +
			"  us01s-epm03.am.mt.mtnet                70989 mb        8.4%    1.724%\n" + 
			"  us40s-ecompub03.extranet.mt.com        47436 mb        5.6%    1.046%\n" +
			"  us01s-epm08.am.mt.mtnet                46621 mb        5.5%    2.690%\n" + 
			"Total for all clients                   847292 mb      100.0%    0.005%";
	
	//System.out.println(cap);
	
	//String[] splitArray = cap.split("\n");
	
	
	for ( String s : cap.split("\n")) {
		String[] sline = s.split("\\s+");
		if (isDate(sline[0]))
			System.out.println(s);
			}
	}

	
	public static ArrayList<SimpleDateFormat> loadFormats() {

		ArrayList<SimpleDateFormat> dateFormats = new ArrayList<SimpleDateFormat>();
		dateFormats.add(new SimpleDateFormat("yyyy-MM-dd"));
		dateFormats.add(new SimpleDateFormat("yyyy MM dd"));
		dateFormats.add(new SimpleDateFormat("yyyy.MM.dd"));
		dateFormats.add(new SimpleDateFormat("yyyy-MMM-dd"));
		dateFormats.add(new SimpleDateFormat("yyyy MMM dd"));
		dateFormats.add(new SimpleDateFormat("yyyy.MMM.dd"));
		dateFormats.add(new SimpleDateFormat("dd-MM-yyyy"));
		dateFormats.add(new SimpleDateFormat("dd MM yyyy"));
		dateFormats.add(new SimpleDateFormat("dd.MM.yyyy"));
		dateFormats.add(new SimpleDateFormat("dd/MM/yyyy"));
		dateFormats.add(new SimpleDateFormat("dd-MM-yy"));
		dateFormats.add(new SimpleDateFormat("dd MM yy"));
		dateFormats.add(new SimpleDateFormat("dd.MM.yy"));
		dateFormats.add(new SimpleDateFormat("dd/MM/yy"));
		dateFormats.add(new SimpleDateFormat("dd-MMM-yy"));
		dateFormats.add(new SimpleDateFormat("dd MMM yy"));
		dateFormats.add(new SimpleDateFormat("dd.MMM.yy"));
		dateFormats.add(new SimpleDateFormat("dd/MMM/yy"));
		dateFormats.add(new SimpleDateFormat("dd-MMM-yyyy"));
		dateFormats.add(new SimpleDateFormat("dd MMM yyyy"));
		dateFormats.add(new SimpleDateFormat("dd.MMM.yyyy"));
		dateFormats.add(new SimpleDateFormat("dd/MMM/yyyy"));
		dateFormats.add(new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"));
		dateFormats.add(new SimpleDateFormat("yyyy MM dd hh:mm:ss"));
		dateFormats.add(new SimpleDateFormat("yyyy.MM.dd hh:mm:ss"));
		dateFormats.add(new SimpleDateFormat("yyyy/MM/dd hh:mm:ss"));
		dateFormats.add(new SimpleDateFormat("yyyy-MMM-dd hh:mm:ss"));
		dateFormats.add(new SimpleDateFormat("yyyy MMM dd hh:mm:ss"));
		dateFormats.add(new SimpleDateFormat("yyyy.MMM.dd hh:mm:ss"));
		dateFormats.add(new SimpleDateFormat("yyyy/MMM/dd hh:mm:ss"));
		dateFormats.add(new SimpleDateFormat("dd-MM-yyyy hh:mm:ss"));
		dateFormats.add(new SimpleDateFormat("dd MM yyyy hh:mm:ss"));
		dateFormats.add(new SimpleDateFormat("dd.MM.yyyy hh:mm:ss"));
		dateFormats.add(new SimpleDateFormat("dd/MM/yyyy hh:mm:ss"));
		dateFormats.add(new SimpleDateFormat("dd-MMM-yyyy hh:mm:ss"));
		dateFormats.add(new SimpleDateFormat("dd MMM yyyy hh:mm:ss"));
		dateFormats.add(new SimpleDateFormat("dd.MMM.yyyy hh:mm:ss"));
		dateFormats.add(new SimpleDateFormat("dd/MMM/yyyy hh:mm:ss"));

		return dateFormats;
		}
	
	  public static boolean isDate(String date) {
		  
			ArrayList<SimpleDateFormat> dateFormats = new ArrayList<SimpleDateFormat>();
			
			dateFormats = loadFormats();
			
		  // add more date formats if you want
			
		    Date myDate = null;
			
			for (SimpleDateFormat myFormat : dateFormats) {
				 
				  myFormat.setLenient(false);
				 
				  try {
				    myDate = myFormat.parse(date);
				    //System.out.println(myFormat.toPattern() + " : " + myDate.toGMTString());
				    return true;
				  } catch (Exception e) {
				  }
				 
				}
				 
				return false;
		  }

		
		//System.out.println(s);
	  String combine(String[] s, String glue)
	  {
	    int k=s.length;
	    if (k==0)
	      return null;
	    StringBuilder out=new StringBuilder();
	    out.append(s[0]);
	    for (int x=1;x<k;++x)
	      out.append(glue).append(s[x]);
	    return out.toString();
	  }
}
	
		


